package com.example.s01helloworld.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

// @Component

// @Controller
// @Service
// @Repository


// @Controller  控制器
// @RestController  = @Controller @ResponseBody
// 表示该控制器下返回的信息都是json 不用去请求转发视图

@RestController
public class HelloController
{
    @RequestMapping("/hello")
    public String hello()
    {
        return "Hello world!";
    }

}
